package com.example.mytayunapi.Service;


import com.example.mytayunapi.Entity.ComplaintsInfo;
import com.example.mytayunapi.Entity.userInfo;
import com.example.mytayunapi.Mapper.ComplaintsInfoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ComplaintsInfoServiceImpl implements ComplaintsInfoService{
    @Autowired
    private ComplaintsInfoMapper complaintsInfoMapper;

    @Override
    public List<ComplaintsInfo> getComplaintsInfo() {
        return complaintsInfoMapper.getComplaintsInfo();
    }

    @Override
    public List<ComplaintsInfo> getComplaintsInfoById(Integer Complaint_id) {
        return complaintsInfoMapper.getComplaintsInfoById(Complaint_id);
    }

    @Override
    public Integer updateComplaintsInfo(ComplaintsInfo complaintsInfo) {
        return complaintsInfoMapper.updateComplaintsInfo(complaintsInfo);
    }

    @Override
    public Integer deleteByID(Integer Complaint_id) {
        return complaintsInfoMapper.deleteByID(Complaint_id);
    }

    //分页
    @Override
    public PageInfo<ComplaintsInfo> getPageInfo(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<ComplaintsInfo> ComplaintsInfo = complaintsInfoMapper.getComplaintsInfo();
        PageInfo<ComplaintsInfo> pageInfo = new PageInfo<>(ComplaintsInfo);
        return pageInfo;
    }
}
